package com.stormragetech.teamwork.module.user.spring.mongo.impl;

import com.stormragetech.common.exception.StormragetechException;
import com.stormragetech.teamwork.module.user.entity.UserMongo;
import com.stormragetech.teamwork.spring.dao.MongoDao;
import com.stormragetech.teamwork.module.user.spring.mongo.UserMongoDao;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * description: //TODO
 *
 * @author: Xue Bin
 * @version: 1.0.0-SNAPSHOT
 */
@Repository
public class UserMongoDaoImpl extends MongoDao<UserMongo> implements UserMongoDao {

    public UserMongoDaoImpl(MongoTemplate template) {
        super(template);
    }

    @Override
    public void insert(UserMongo entity) throws StormragetechException {
        insert(entity, "user");
    }

    @Override
    public List<UserMongo> find() throws StormragetechException {

        return findAll("user", UserMongo.class);
    }

}
